<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/hongkou.tld" prefix="page"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
		<title>上海软件</title>
		<link href="fun/style.css" rel="stylesheet" type="text/css" />
	</head>

	<body>
		<script language="JavaScript" type="text/javascript"
			src="js/calander/calander.js"></script>
		<br />
		<form action="queryImage.do" method="post" name="form1"
			enctype="multipart/form-data">
			<table width="100%" height="250" cellpadding="0" cellspacing="0">
				<tr>
					<td class="td_heng" colspan=4>
						图片组创建&nbsp;
					</td>
				</tr>
				<tr>
					<td width="25%">
						图片组:&nbsp;
						<input type="text" name="imageGroupName" />
					</td>
					<td width="25%">
						&nbsp;
					</td>
					<td width="25%">
						&nbsp;
					</td>
					<td width="25%">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td align="center" colspan=4>
						<div align="center">
							<input type="button" name="submit2" value="提交"
								onclick="javascript:createImageGroup();" />
							<input type="reset" name="cancel" value="取消" />
						</div>
					</td>
				</tr>
				<tr>
					<td class="td_heng" colspan=4>
						图片上传&nbsp;
					</td>
				</tr>
				<tr>
					<td width="25%">
						图片名称:&nbsp;
						<input type="text" name="imageName" />
					</td>
					<td width="25%">
						类型:&nbsp;
						<page:codeTable tableName="T_IMAGE_CATEGORY" name="category" />
					</td>
					<td width="25%">
						<input class=inputdate onclick=OpenDate(shootingTime) type=button
							value='拍摄时间' style="width: 45; height: 18" />
						<input class=inputdate readonly size=13 name=shootingTime
							style="width: 86; height: 18" />
					</td>
					<td width="25%">
						关键字:&nbsp;
						<input type="text" name="keyWord" />
					</td>
				</tr>
				<tr>
					<td >
						图片组
						<page:codeTable tableName="T_IMAGE_GROUP" name="imageGroup"
							nullOption="Y" value="$imageGroup$" />
					</td>
					<td colspan=3>
						&nbsp;
					</td>
				</tr>
				<tr>
					<td colspan=4>
						<div align="left" >
							上传:&nbsp;
							<span id="files">
							<input type="file" name="file" />
							</span>
						</div>
					</td>
				</tr>
				<tr>
					<td align="center" colspan=4>
						<div align="center">
						<input type="button" onclick="addComponent();" value="添加文件"/>
							<input type="button" name="submit1" value="提交"
								onclick="javascript:uploadImage();" />
							<input type="reset" name="cancel" value="取消" />
						</div>
					</td>
				</tr>
			</table>
		</form>
		<script language="javascript">
	function addComponent() {
		  var dateTime=new Date();
          var hh=dateTime.getHours();
          var mm=dateTime.getMinutes();
		  var ss=dateTime.getSeconds();
		var uploadHTML = document.createElement("<input type='file' name='"+hh+mm+ss+"'/>");
        document.getElementById("files").appendChild(uploadHTML);
        document.getElementById("files").appendChild(uploadHTML);
	}
function uploadImage(){
	form1.action="uploadImage.do";
	form1.submit();
}
function createImageGroup(){
	form1.action="createImageGroup.do?imageGroupName="+form1.imageGroupName.value;
	form1.submit();
}

<%
if(request.getAttribute("attribute_exception")!=null){
	%>
	alert("<%=request.getAttribute("attribute_exception")%>");
	<%
}
if(request.getAttribute("action_result")!=null){
%>
	alert("<%=request.getAttribute("action_result")%>");
<%}%>
</script>

	</body>
</html>